<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" href="/skin/css/amazeui.min1.css" />
<link href="/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/skin/css/index.css" rel="stylesheet" type="text/css" />
<script src="/user/js/jquery.js"></script>
<script src="/skin/js/toast.js"></script>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>修改资料-会员中心</title>
<script>
	// 设计稿 375px，1rem = 100px，换算方法：px值 ÷ 100 = rem值
	(function(){
		var docEl = document.documentElement;
		var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
		function recalc() {
			var clientWidth = docEl.clientWidth;
			if (!clientWidth) return;
			docEl.style.fontSize = (clientWidth / 375 * 100) + 'px';
		}
		if (!document.addEventListener) return;
		window.addEventListener(resizeEvt, recalc, false);
		document.addEventListener('DOMContentLoaded', recalc, false);
		recalc();
	})();
</script>
<style>
	:root{ --card:#fff; --line:#eef2f7; --text:#0f172a; --muted:#9aa3b2; --primary:#253043; }
	a{-webkit-tap-highlight-color:transparent;outline:none;}
	body{ background:#f3f5f8; }
	
	/* 表单卡片 */
	.form-card{ 
		background:var(--card); 
		margin:0.2rem 0; 
		overflow:hidden; 
		box-shadow:0 0.03rem 0.18rem rgba(0,0,0,.05); 
	}
	.form-item{ 
		display:flex; 
		align-items:center; 
		padding:0.16rem; 
		border-bottom:0.01rem solid var(--line); 
		position:relative; 
	}
	.form-item:last-child{ 
		border-bottom:0; 
	}
	.form-label{ 
		width:0.88rem; 
		flex:0 0 0.88rem; 
		color:#1f2937; 
		font-weight:600; 
		font-size:0.14rem; 
	}
	.form-control{ 
		flex:1; 
		display:flex; 
		align-items:center; 
		gap:0.08rem; 
		min-width:0; 
	}
	.form-control input[type=text]{ 
		width:100%; 
		border:0; 
		background:transparent; 
		outline:none; 
		font-size:0.14rem; 
		color:#111827; 
		padding:0; 
		margin:0; 
		-webkit-tap-highlight-color:transparent;
	}
	.form-control input::placeholder{ 
		color:#c0c7d2; 
	}
	.form-value {
		flex: 1;
		font-size: 0.14rem;
		color: #64748b;
		text-align: right;
	}
	
	/* 提交按钮 */
	.page-actions{ 
		padding:0.2rem; 
	}
	.primary-btn{ 
		width:100%; 
		height:0.48rem; 
		border:0; 
		border-radius:0.04rem; 
		background:#253043; 
		color:#fff; 
		font-size:0.16rem; 
		font-weight:700; 
		-webkit-tap-highlight-color:transparent;
		outline:none;
	}
	.primary-btn:active {
		background: #1f2937;
	}
	
	/* 退出按钮 */
	.logout-btn {
		width: 100%;
		height: 0.48rem;
		border: 0.01rem solid #e5e7eb;
		border-radius: 0.04rem;
		background: #fff;
		color: #64748b;
		font-size: 0.16rem;
		font-weight: 600;
		margin-top: 0.12rem;
		-webkit-tap-highlight-color: transparent;
		outline: none;
	}
	.logout-btn:active {
		background: #f9fafb;
	}
</style>
</head>
<body class="body">
<div class="main">
<div class="editzl">
	<header id="header">
		<section class="head-b head-b1">
			<span class="u-left"><a href="javascript:history.go(-1);" class="back"><img src="/skin/img/back.png"/></a></span>
			<h1 id="t0">修改资料</h1>
			<div class="u-right" href="#">
				<a href="/" class="hSearch right"><img src="/skin/img/i_home.png"/></a>
			</div>
		</section>
	</header>
	
	<form class="xx">
		<div class="form-card">
			<div class="form-item">
				<div class="form-label">帐号</div>
				<div class="form-control">
					<span class="form-value">{$info[uname]}</span>
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">手机号</div>
				<div class="form-control">
					<span class="form-value">{$info[phone]}</span>
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">姓名</div>
				<div class="form-control">
					<input type="text" style="text-align: right;" name="xm" placeholder="请填写会员姓名" value="{$info[tname]}" />
				</div>
			</div>				
			<div class="form-item">
				<div class="form-label">等级</div>
				<div class="form-control">
					<span class="form-value">{$tdarr[$info[level]]}</span>
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">团队等级</div>
				<div class="form-control">
					<span class="form-value">{$tdarr1[$info[tlevel]]}</span>
				</div>
			</div>
			{if($info['tjid']>0)}
			<div class="form-item">
				<div class="form-label">推荐人</div>
				<div class="form-control">
					<span class="form-value">{$info[tjname]}</span>
				</div>
			</div>
			{else}
			{if($info['Id']>1)}
			<div class="form-item">
				<div class="form-label">邀请码</div>
				<div class="form-control">
					<input type="text" name="yqcode" placeholder="请输入6位数字邀请码" value="" />
				</div>
			</div>	
			{/if}
			{/if}
		</div>
		
		<div class="page-actions">
			<button class="primary-btn" type="button" onclick="edit();">确认修改</button>
			<button class="logout-btn" type="button" onclick="logout();">退出账号</button>
		</div>
	</form>
</div>
</div>

<script>
function edit(){
	$.ajax({
		type:"post",
		dataType:"json",
		url:"/Moudelu.php?m=m&a=useredit",
		data:$(".xx").serialize(),
		success:function(d){
			if(d[0]==2){
				window.location.href='login.php';
				return false;
			}else if(d[0]==0){
				showToast(d[1], 'error');
			}else{
				showToast(d[1], 'success');
				window.location.href='/user/';
			}
		}
	});
}

function logout(){
	if(!confirm('确定要退出账号吗？')) return;
	
	$.ajax({
		type:"post",
		dataType:"json",
		url:"/Moudelu.php?m=m&a=logout",
		success:function(d){
			if(d[0]==0){
				showToast(d[1], 'error');
			}else{
				showToast('退出成功', 'success');
				setTimeout(function(){
					window.location.href='/login.php';
				}, 1000);
			}
		}
	});
}
</script>
{include(foot)}
</body>
</html>
